package personalisation;

import java.awt.Point;
import java.util.Stack;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.SpriteSheet;
import org.newdawn.slick.UnicodeFont;
import org.newdawn.slick.font.effects.ColorEffect;

import t2s.SIVOXDevint;
import elements.Case;
import elements.Tuyau;
import jeu.Jeu;
import jeu.Niveau;

public class ConstructionPersonalise extends Jeu {

	public ConstructionPersonalise() {
		super();
	}
	
	public void init(GameContainer container) throws SlickException {
		container.setVSync(true);
		//container.setForceExit(false);
		niveau = new NiveauPersonalise();
		compteur = 0;

		SpriteSheet sheet = new SpriteSheet("../ressources/tiledMap2_ModeA/BonSpriteSheet.png", 96, 96);
		tuyauCourant = new Tuyau();
		tuyauCourant.setAutoUpdate(false);
		for (int frame = 0; frame < 14; frame++) {
			tuyauCourant.addFrame(sheet.getSprite(frame, 0), 150);
		}

		premierePiece = true;
		deuxiemeEtape = false;
		dejaFait = false;
		niveauxFinis = false;
		rotation = false;
		intro = false;
		peutMettre = new boolean[6];
		for (int i = 0; i < 6; i++) {
			peutMettre[i] = false;
		}

		casePrecedentes = new Stack<Case>();
		piecesPosees = new Stack<Integer>();
		typesPrecedents = new Stack<Tuyau.Type>();
		anciennesPieces = new Stack<Case>();
		piecesMenu = new Stack<Integer>();

		xPiecePosee = niveau.getDepart().getxPosition() * 96;
		yPiecePosee = niveau.getDepart().getyPosition() * 96;

		temps = 60000;

		this.devint = new SIVOXDevint();
		this.font = new UnicodeFont("../ressources/images/impact.ttf", 72, false, false);
		this.font.getEffects().add(new ColorEffect(java.awt.Color.white));
		this.font.addAsciiGlyphs();
		this.font.loadGlyphs();
		this.uFont = new UnicodeFont("../ressources/images/impact.ttf", 35, false, false);
		this.uFont.getEffects().add(new ColorEffect(java.awt.Color.white));
		this.uFont.addAsciiGlyphs();
		this.uFont.loadGlyphs();
		
		compteurPieces = 0;
	}

}
